package com.wing.wcabinet.model.response;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import com.wing.wcabinet.model.entity.WcabCellAllocationDetail;
import java.math.BigDecimal;

/**
 * 调拨明细VO
 *
 * @author
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
public class WcabCellAllocationDetailVO {

    /**
     * ID
     */
    private Long id;

    /**
     * 创建时间
     */
    @JsonFormat(timezone = "GMT+8" , pattern = "yyyy-MM-dd HH:mm:ss" )
    private LocalDateTime createTime;

    /**
     * 创建者
     */
    private Long creator;

    /**
     * 修改者
     */
    private Long modifier;

    /**
     * 创建人
     */
    private String creatorName;

    /**
     * 修改人
     */
    private String modifierName;

    /**
     * 调拨id
     */
    private Long allocationId;

    /**
     * 调拨数量
     */
    private Integer quantity;

    /**
     * 调拨重量
     */
    private BigDecimal weight;

    /**
     * 柜子编码
     */
    private String cabCode;

    /**
     * 货道编号
     */
    private String spaceCode;

    /**
     * skuCode
     */
    private String skuCode;

    /**
     * 柜子id
     */
    private Long cabId;

    /**
     * 货道id
     */
    private Long spaceId;

    /**
     * sku id
     */
    private String skuId;

    /**
     * 模板柜子code
     */
    private String cabCodeTarget;

    /**
     * 模板柜子id
     */
    private Long cabIdTarget;

    /**
     * 模板货道code
     */
    private String spaceCodeTarget;

    /**
     * 目标货道id
     */
    private Long spaceIdTarget;

    /**
     * 调拨方式
     */
    private WcabCellAllocationDetail.Type type;

    /**
    * 调拨方式描述
    */
    @TableField(exist = false)
    private String typeDesc;

    public String getTypeDesc() {
        return type.getDesc();
    }


    private String skuName;

    private String skuSpec;

    private String skuSpecOld;

    private String skuCodeOld;

    private String skuPic;

    private BigDecimal marketPrice;

    private String productTypeName;

    private String productCategoryName;

    private String productBrandName;

    private String unitName;

    private String enterpriseCode;

    private BigDecimal skuWeightUnit;

    private String remark;

    private WcabCellAllocationDetail.BusinessType businessType;

    private String businessTypeDesc;

    public String getBusinessTypeDesc(){
        if (this.businessType!=null){
            return this.businessType.getDesc();
        }
        return "";
    }

}
